﻿using OrderStateMachineWebApi.Models;
using OrderStateMachineWebApi.Services;

namespace OrderStateMachineWebApi.ServicesImpl
{
    public class OrderStateFactory
    {
        public IOrderState GetState(OrderStatus status)
        {
            return status switch
            {
                OrderStatus.PendingPayment => new PendingPaymentState(),
                OrderStatus.Paid => new PaidState(),
                //OrderStatus.Processing => new ProcessingState(),
                //OrderStatus.Shipped => new ShippedState(),
                //OrderStatus.Completed => new CompletedState(),
                //OrderStatus.Cancelled => new CancelledState(),
                //OrderStatus.Refunding => new RefundingState(),
                //OrderStatus.Refunded => new RefundedState(),
                _ => throw new ArgumentOutOfRangeException(nameof(status), status, null)
            };
        }
    }

}
